/**
 * Created by Administrator on 2014/12/3.
 */
$(function(){
    $('#login').click(function(){
        var username = $('#username').val();
        var password = $('#password').val();
        if(!username){window.error('用户名称不允许为空');return;}
        if(!/^[0-9a-zA-Z_]{5,25}$/.test(username)){
            window.error('用户名称由数字、字母或下划线组成且不小于5位');return;
        }
        if(!password){window.error('用户密码不允许为空');return;}
        $(this).parents('form')[0].submit();
    })
})